{template header}
<style>
	.m-success, .m-warn, .m-error {
		background: url("{ADMIN_WEBURLPATH}/images/ico-pa.png") no-repeat scroll 0 0 transparent;
		padding-left: 20px;
		
	}
	.m-success {
		background-position: -164px -390px;
	}
	.m-warn {
		background-position: -59px -480px;
	}
	.m-error {
		background-position: -124px -420px;
	}
</style>

<!--{if $webglobal[mode]=='brandedit'}-->
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/editor/kindeditor-min.js"></script>
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>VIP品牌管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=brand&{$webrequest[gourl]}">[VIP品牌列表]</a>
			</td></tr>
		</tbody>
	</table>

	<form name="editform" method="post" enctype="multipart/form-data" action="{ADMIN_WEBURLPATH}/index.php?mode=brandedit&check&gourl={$webglobal[file_brand][gourlencode]}">
	<input type="hidden" name="editid" value="{$webrequest[editid]}" />
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">修改VIP品牌</td></tr>
		</thead>
		<tbody>
			<tr>
				<th>商品标题<span class="need"> *</span></th>
				<td>
					<input type="text" name="name" size="70" value="{$webglobal[file_brand][editinfo][name]}" />
				</td>
			</tr>
			<tr>
				<th>图片<div>格式：jpg,gif,png</div></th>
				<td>
					<input type="file" name="image" size="40" /><!--{if $webglobal[file_brand][editinfo][logo]!=''}-->&nbsp;&nbsp;<img src="{WEBURLPATH}{$webglobal[file_brand][editinfo][logo]}" height="50" alt="" border="0" /><input type="checkbox" name="image_del" id="image_del" value="1" /><label for="image_del">删除当前图片</label><!--{/if}-->
				</td>
			</tr>
			<tr>
				<th>商品描述<span class="need"> *</span></th>
				<td>
					<script>
						KE.show({
							id : 'description',
							items : ['source', '|', 'undo', 'redo', 'cut', 'copy', 'paste',
									'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
									'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
									'superscript', '|', 'selectall', 'fullscreen', '-',
									'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
									'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',
									'flash', 'media', 'advtable', '|', 'link', 'unlink', '|', 'pagebreak'],
							imageUploadJson : '{WEBURLPATH}/editor/editorup.php?upfrom=brand',
							resizeMode : 1
						});
					</script>
					<textarea id="description" name="description" style="width:100%;height:200px;">{$webglobal[file_brand][editinfo][description]}</textarea>
				</td>
			</tr>
			<tr>
				<th>区域选择<span class="need"> *</span></th>
				<td>
						<select id="citySelect" name="area_id"class="mySelect" >
						<!--{loop $webglobal[file_brand][citydata] $tempkey $tempvalue}-->
						<option value="{$tempvalue[id]}"{if $webglobal[file_brand][editinfo]['area_id']==$tempvalue['id']} selected="selected"{/if}>{$tempvalue[name]}</option>
						<!--{/loop}-->
						</select>
				</td>
			</tr>
			<tr>
				<th>状态</th>
				<td>
					<select name="status">
						<option value="1" {if $webglobal[file_brand][editinfo]['status']==1} selected="selected"{/if}>显示</option>
						<option value="0" {if $webglobal[file_brand][editinfo]['status']==0} selected="selected"{/if}>不显示</option>
						<option value="-1" {if $webglobal[file_brand][editinfo]['status']==-1} selected="selected"{/if}>已删除</option>
					</select>
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="2">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>
<!--{elseif $webglobal[mode]=='brandadd'}-->

	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/editor/kindeditor-min.js"></script>
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>VIP品牌管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=brand">[商品列表]</a>
			</td></tr>
		</tbody>
	</table>

	<form name="addform" method="post" enctype="multipart/form-data" action="{ADMIN_WEBURLPATH}/index.php?mode=brandadd&check">
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">添加VIP品牌</td></tr>
		</thead>
		<tbody>
			<tr>
				<th>品牌名称<span class="need"> *</span></th>
				<td>
					<input type="text" name="name" size="70" value="" />
				</td>
			</tr>
			<tr>
				<th>LOGO<div>格式：jpg,gif,png</div></th>
				<td>
					<input type="file" name="image" size="40" />
				</td>
			</tr>
			<tr>
				<th>品牌描述<span class="need"> *</span></th>
				<td>
					<script>
						KE.show({
							id : 'description',
							items : ['source', '|', 'undo', 'redo', 'cut', 'copy', 'paste',
									'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
									'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
									'superscript', '|', 'selectall', 'fullscreen', '-',
									'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
									'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',
									'flash', 'media', 'advtable', '|', 'link', 'unlink', '|', 'pagebreak'],
							imageUploadJson : '{WEBURLPATH}/editor/editorup.php?upfrom=brand',
							resizeMode : 1
						});
					</script>
					<textarea id="description" name="description" style="width:100%;height:200px;"></textarea>
				</td>
			</tr>
			<tr>
				<th>区域选择<span class="need"> *</span></th>
				<td>
						<select id="citySelect" name="area_id"class="mySelect" >
						<!--{loop $webglobal[file_brand][citydata] $tempkey $tempvalue}-->
						<option value="{$tempvalue[id]}" >{$tempvalue[name]}</option>
						<!--{/loop}-->
						</select>
				</td>
			</tr>
			<tr>
				<th>状态</th>
				<td>
					<select name="status">
						<option value="1">显示</option>
						<option value="0">不显示</option>
					</select>
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="2">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>
<!--{elseif $webglobal[mode]=='integralorder'}-->

	<script type="text/javascript" src="{WEBURLPATH}/javascript/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/javascript/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/javascript/jqueryPlugin.js"></script>
	<link rel="stylesheet" type="text/css" href="{WEBURLPATH}/javascript/fancybox/jquery.fancybox-1.3.4.css" media="screen" />

	<form name="searchform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=integralorder">
	<table class="datatable" cellspacing="1">
		<thead>
			<tr>
				<td colspan="3">搜索订单</td>
			</tr>
		</thead>
		<tbody>
			<tr>
				<th style="width: 100px;">搜索选项</th>
				<td>
					<select name="status">
						<option value="999">-- 全部状态 --</option>
						<option value="0">待审核</option>
						<option value="1">审核通过</option>
						<option value="2">已发货</option>
						<option value="3">确认收货</option>
					</select>
					<script type="text/javascript">
						common_CheckedSelect('status', '{$webglobal[CPP][status]}');
					</script>
					关键字:<input type="text" name="searchkey" value="$webglobal[CPP][searchkey]" size="50" />
				</td>
				<td style="width: 100px; text-align: center"><input type="submit" name="searchsubmit" value=" 搜  索 " /></td>
			</tr>
		</tbody>
	</table>
	</form>

	<form name="editform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=integralorderup&check&gourl={$webglobal[file_integral][gourlencode]}">
	<table class="datatable" cellspacing="1" id="audit">
		<thead>
			<tr>
				<th><input class="selectAll" type="checkbox" />全选</th>
				<th>订单状态</th>
				<th>兑换用户</th>
				<th>兑换商品</th>
				<th>兑换数量</th>
				<th>商品积分</th>
				<th>消耗总积分</th>
				<th><a href="{ADMIN_WEBURLPATH}/index.php?mode=integral&order=addtime{$webglobal[file_integral][searchurl]}" class="special" title="点击按此排序">订单时间<!--{if $webglobal[CPP][order]=='pubtime'}-->↓<!--{/if}--></a></th>
				<th width="10%">管理</th>
			</tr>
		</thead>
		<tbody>
			<!--{if $webglobal[file_integral][datanum]>0}-->
				<!--{loop $webglobal[file_integral][dataarray] $tempkey $temptable}-->
					<tr>
						<td{$temptable[tdclass]}>
							<input type="checkbox" name="auditid[]" value="{$tempkey}" class="selectUnit" />
							
						</td>
						<td{$temptable[tdclass]}>
							{if $temptable[status] == 0}
							待审核
							{elseif $temptable[status] = 1}
							审核通过
							{elseif $temptable[status] = 2}
							发货
							{elseif $temptable[status] = 3}
							确认收货
							{/if}
						</td>
						<td{$temptable[tdclass]}>
							{if $temptable[user_status_show]}
								{$temptable[u_email]}
								<strong title="{$temptable[user_status_show][1]}" class="{$temptable[user_status_show][0]}"></strong>
							{else}
							用户不存在
							{/if}
						</td>
						<td{$temptable[tdclass]}>
							{if (isset($temptable[g_id]) && $temptable[g_id])}
								{$temptable[g_name]}
								{if $temptable[g_status] == 1}
									<strong class="m-success" title="可兑换"></strong>
								{else}
									<strong class="m_error" title="不可兑换"></strong>
								{/if}
								
							{else}
								商品不存在
							{/if}
						</td>
						<td{$temptable[tdclass]}>
							{$temptable[quantity]}
						</td>
						<td{$temptable[tdclass]}>
							{$temptable[unit_score]}
						</td>
						<td{$temptable[tdclass]}>
							{$temptable[total_score]}
						</td>
						<td{$temptable[tdclass]}>
							{$temptable[addtime_show]}
						</td>
						<td{$temptable[tdclass]}>
							<!-- <a href="{ADMIN_WEBURLPATH}/index.php?mode=integralorderedit&editid={$tempkey}&gourl={$webglobal[file_integral][gourlencode]}" class="special">[编辑订单状态]</a> -->
						</td>
					</tr>
				<!--{/loop}-->
			<!--{else}-->
				<tr><td colspan="12" style="text-align: center">还没有积分兑换订单。</td></tr>
			<!--{/if}-->
		</tbody>
	</table>

	<!--{if $webglobal[file_integral][datanum]>0}-->
		<table style="width:100%;border-style:none;" cellpadding="0" cellspacing="0">
			<tr>
				<td style="margin:0;padding:0;">
				<select name="">
					<option value="-1">选择操作方式</option>
					<option value="1">审核通过</option>
					<option value="2">发货</option>
					<option value="3">用户确认收货</option>
				</select>
				<input type="submit" name="adminsubmit" value=" 批量操作 " />
				</td>
				<td style="text-align:right;margin:0;padding:5px 0;">{template page}</td>
			</tr>
		</table>
	<!--{/if}-->
	</form>
	<script type="text/javascript">
		$(document).ready(function() {
			$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

			function selectall() {
				$('.selectUnit').each(function(){
					if($('.selectAll').attr('checked')){
						$(this).attr('checked',true);
					}else{
						$(this).attr('checked',false);
					}
				});
			}
			$('.selectAll').bind('click', selectall);
		});
	</script>
<!--{elseif $webglobal[mode]=='brand'}-->

	<script type="text/javascript" src="{WEBURLPATH}/javascript/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/javascript/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/javascript/jqueryPlugin.js"></script>
	<link rel="stylesheet" type="text/css" href="{WEBURLPATH}/javascript/fancybox/jquery.fancybox-1.3.4.css" media="screen" />

	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>品牌信息管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=brandadd">[添加品牌]</a>
			</td></tr>
		</tbody>
	</table>

	<form name="searchform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=brand">
	<table class="datatable" cellspacing="1">
		<thead>
			<tr>
				<td colspan="3">搜索品牌</td>
			</tr>
		</thead>
		<tbody>
			<tr>
				<th style="width: 100px;">搜索选项</th>
				<td>
					<select name="status">
						<option value="1">显示</option>
						<option value="0">不显示</option>
						<option value="-1">删除</option>
					</select>
					<script type="text/javascript">
						common_CheckedSelect('status', '{$webrequest[status]}');
					</script>
					关键字:<input type="text" name="searchkey" value="$webrequest[searchkey]" size="50" />
				</td>
				<td style="width: 100px; text-align: center"><input type="submit" name="searchsubmit" value=" 搜  索 " /></td>
			</tr>
		</tbody>
	</table>
	</form>

	<form name="editform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=brandup&check&gourl={$webglobal[file_brand][gourlencode]}">
	<table class="datatable" cellspacing="1" id="audit">
		<thead>
			<tr>
				<th width="7%"><input class="selectAll" type="checkbox" /></th>
				<th width="10%">状态</th>
				<th>图片</th>
				<th>公司介绍</th>
				<th>所在区域</th>
				<th width="10%">管理</th>
			</tr>
		</thead>
		<tbody>
			<!--{if $webglobal[file_brand][datanum]>0}-->
				<!--{loop $webglobal[file_brand][dataarray] $tempkey $temptable}-->
					<tr>
						<td{$temptable[tdclass]}><input type="checkbox" name="delid[]" value="{$tempkey}" class="selectUnit" /></td>
						<td{$temptable[tdclass]}>
							<!--{if $temptable[status]==1}-->
								<span class="green">已显示</span>
							<!--{elseif $temptable[status]==0}-->
								<span class="dark">未显示</span>
							<!--{elseif $temptable[status]==-1}-->
								已删除
							<!--{else}-->
								未显示
							<!--{/if}-->
						</td>
						<td{$temptable[tdclass]}>
						<!--{if $temptable[logo] != ''}-->
						<a rel="example_group" href="{WEBURLPATH}{$temptable[logo]}" title=""><img alt="" src="{WEBURLPATH}{$temptable[logo]}" width="150px" height="100px" /></a>
						<!--{else}-->
						<a rel="example_group" href="{WEBURLPATH}/images/no_coupon.gif" title=""><img alt="" src="{WEBURLPATH}/images/no_coupon.gif" /></a>
						<!--{/if}-->
						</td>
						<td{$temptable[tdclass]}>
							{$temptable[name]}
						</td>
						<td{$temptable[tdclass]}>
							{$webglobal[file_brand][areaArray][$temptable[area_id]]}
						</td>
						<td{$temptable[tdclass]}>
							<a href="{ADMIN_WEBURLPATH}/index.php?mode=brandedit&editid={$tempkey}&gourl={$webglobal[file_brand][gourlencode]}" class="special">[编辑]</a>
						</td>
					</tr>
				<!--{/loop}-->
			<!--{else}-->
				<tr><td colspan="11" style="text-align: center">没有品牌在数据库。</td></tr>
			<!--{/if}-->
		</tbody>
	</table>

	<!--{if $webglobal[file_brand][datanum]>0}-->
		<input type="hidden" name="access" id="access" value="update">
		<table style="width:100%;border-style:none;" cellpadding="0" cellspacing="0">
			<tr>
				<td><input type="submit" name="deletesubmit" id="deletesubmit" value=" 批量删除 " />&nbsp;&nbsp;<input type="submit" name="adminsubmit" value=" 批量显示 " id="updatesubmit" />&nbsp;&nbsp;<input type="submit" name="adminsubmit" value=" 批量不显示 " id="updatedownsubmit" /></td>
				<td style="text-align:right;margin:0;padding:5px 0;">{template page}</td>
			</tr>
		</table>
	<!--{/if}-->
	</form>
	<script type="text/javascript">
		$(document).ready(function() {
			$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

			function selectall() {
				$('.selectUnit').each(function(){
					if($('.selectAll').attr('checked')){
						$(this).attr('checked',true);
					}else{
						$(this).attr('checked',false);
					}
				});
			}
			$('.selectAll').bind('click', selectall);
			$('#deletesubmit').click(function(){
				$('#access').val('delete');
			});
			$('#updatesubmit').click(function(){
				$('#access').val('update');
			});
			$('#updatedownsubmit').click(function(){
				$('#access').val('updatedown');
			});
		});
	</script>
<!--{/if}-->

{template footer}